package pl.edu.pw.polygen.ui.tabsheet;

import java.util.HashMap;
import java.util.Map;

import pl.edu.pw.polygen.beans.FileBean;

import com.vaadin.ui.Component;
import com.vaadin.ui.TabSheet;

public class PolygenTabSheet extends TabSheet {

	private static final long serialVersionUID = 2736995098282791239L;

	private Map<String, FileBean> fileBeanMap;
	
	public PolygenTabSheet() {
		super();
		fileBeanMap = new HashMap<String, FileBean>();
	}

	public Tab addTab(Component c, FileBean fileBean) {
		fileBeanMap.put(fileBean.getFileName(), fileBean);
		return super.addTab(c, fileBean.getFileName());
	}
	
	public FileBean getFileBean(String name){
		return fileBeanMap.get(name);
	}
	
}
